Skip to content

Conversation

@obenland
Copy link
Member

@obenland obenland commented Nov 5, 2025

Fixes #

Proposed changes:

This PR integrates Gutenberg's boot package for routing/navigation and the theme package for design tokens and theming into the Social Web interface.

Key Changes

  • Add boot package - Gutenberg's admin UI routing, navigation, sidebar, and site hub components
  • Add theme package - Local copy of @wordpress/theme for design system (avoids wp-theme dependency issue)
  • Centralize route definitions - Single source of truth in src/social-web/routes/index.ts
  • Remove custom components - Replace custom layout/sidebar/site-hub with boot's reusable components
  • Add REST API preloading - Preload site data (title, icon) to avoid failed API calls on initial render
  • Enable strictNullChecks - TypeScript strict null checks for TanStack Router compatibility
  • Fix ThemeProvider wrapper - Ensure correct positioning for proper background styling

Architecture

  • Social-web uses boot's Root component for layout
  • Routes centrally defined and registered with boot's store
  • Theme package provides design tokens and ThemeProvider
  • Boot package remains pristine (no modifications)

Other information:

  • Have you written new tests for your changes, if applicable? - N/A (infrastructure change)

Testing instructions:

  1. Navigate to Dashboard → Social Web (/wp-admin/index.php?page=activitypub-social-web)
  2. Verify the sidebar shows:
    • Site icon and title at top
    • Navigation items: Dashboard, Followers, Following, Interactions
  3. Click each navigation item and verify the route changes
  4. Check styling:
    • Dark sidebar background (#1e1e1e)
    • White content area
    • Cards display correctly
  5. Check browser console - No errors or failed API requests
  6. Verify site icon and title display correctly in the site hub

Before & After Screenshots

Before: Custom layout with manual sidebar implementation
After: Boot package integration with centralized routing

Files Changed

  • 90 files: +8,704 insertions, -817 deletions
  • New: boot package (40 files)
  • New: theme package (38 files)
  • New: centralized routes (5 files)
  • Removed: old custom components (9 files)

Recreates the @wordpress/boot package from Gutenberg as an internal
package at src/packages/boot/. This provides a minimal boot system with:
- TanStack Router integration for SPA routing
- Redux store for menu item management
- Navigation components (sidebar, drilldown, dropdown menus)
- Site hub with icon and command palette integration

Also updates tsconfig to use modern JSX transform (react-jsx) to avoid
needing React imports in every file.

Dependencies added:
- @tanstack/history
- @tanstack/react-router
This commit integrates Gutenberg's boot package for routing/navigation and the theme package for design tokens and theming. Key changes:

- Copy @wordpress/theme package to src/packages/theme/ to avoid dependency on wp-theme which doesn't exist in WordPress core
- Add theme design tokens and ThemeProvider for consistent styling
- Update boot's Root component to use theme package
- Centralize route definitions in src/social-web/routes/index.ts
- Replace custom layout components with boot's components
- Enable strictNullChecks in TypeScript for TanStack Router compatibility
- Fix ThemeProvider wrapper positioning to ensure correct background styling
- Preload site data (title, icon, etc.) via wp-api-fetch middleware to avoid failed API calls
- Remove ShortcutProvider wrapper as it renders an unnecessary div and isn't currently needed
- SiteHub now displays site title and icon correctly on initial render

The preloading implementation matches Gutenberg's boot package approach, preloading
the __unstableBase entity data from /wp-json/ endpoint.
@obenland obenland added the Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary. label Nov 5, 2025
@github-actions github-actions bot added [Feature] WP Admin [Focus] Editor Changes to the ActivityPub experience in the block editor [Status] In Progress [Tests] Includes Tests labels Nov 5, 2025
@obenland obenland changed the title Integrate Gutenberg boot package for routing and navigation Experiment: Use boot package Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] WP Admin [Focus] Editor Changes to the ActivityPub experience in the block editor Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary. [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants